<template>
  <footer class="app-footer">
    <div class="footer-content">
      <div class="footer-links">
        <a href="https://gitee.com/zlcode-top" target="_blank" class="footer-link">
          <el-icon><Link /></el-icon>
          Gitee
        </a>
        <a href="https://blog.csdn.net/m0_61784621" target="_blank" class="footer-link">
          <el-icon><Document /></el-icon>
          CSDN 博客
        </a>
      </div>
      <div class="footer-copyright">
        <span>版权所有：ZLCode©One-Oj</span>
      </div>
    </div>
  </footer>
</template>

<script setup>
import { Link, Document } from '@element-plus/icons-vue'
</script>

<style lang="scss" scoped>
.app-footer {
  background-color: #f5f5f5;
  color: #666;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
  margin-top: 40px;
}

.footer-content {
  margin: 0 auto;
  padding: 0 0; // 移除内边距，让左右边距由子元素控制
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap; // 改为不换行，确保左右布局
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-shrink: 0; // 防止被压缩
  padding-left: 20px; // 距离左边20px
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 14px;

  &:hover {
    background-color: #e8e8e8;
    color: #333;
  }

  .el-icon {
    font-size: 16px;
  }
}

.footer-copyright {
  font-size: 14px;
  color: #999;
  flex-shrink: 0; // 防止被压缩
  text-align: right; // 确保右对齐
  padding-right: 20px; // 距离右边20px
}

// 响应式设计
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }

  .footer-link {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .app-footer {
    padding: 15px 0;
  }

  .footer-content {
    padding: 0 15px;
  }

  .footer-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .footer-copyright {
    font-size: 13px;
  }
}
</style>
